<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <input type="text" v-model="obj.name"><br>
        <input type="text" v-model="obj.price"><br>
        <button @click="ca.push(obj);obj = {}">提交</button><br>
        <div v-for="item in ca">
            {{item.name}}
            {{item.price}}
        </div>
    </div>
</body>
<script src="./vue.js"></script>
<script>
    const { createApp, ref, reactive } = Vue
    createApp({
        setup() {
            let obj = reactive({ name: "", price: "" })
            let ca = ref([])
            return {
                obj,
                ca
            }
        }
    }).mount("#app")
</script>

</html>